// Script assets have changed for v2.3.0 see
// https://help.yoyogames.com/hc/en-us/articles/360005277377 for more information
function scr_create_room(){
	
	with(obj_mask)instance_destroy();
	//设置临时变量
	var _i,_j,_w,_h;//位置以及宽高
	
	
	randomize();
	repeat(30)
	{
	_w=irandom_range(6,10);
	_h=irandom_range(6,10);
	_i=irandom(MAP_STAMP_WIDTH-1-_w);
	_j=irandom(MAP_STAMP_HEIGHT-1-_h);
	
	tmp=instance_create_depth((_i*2+1)*16+8,(_j*2+1)*16+8,0,obj_mask);
	tmp.image_xscale=_w*2-1;
	tmp.image_yscale=_h*2-1;
	tmp.i=_i;
	tmp.j=_j;
	tmp.w=_w;
	tmp.h=_h;
	
	with(tmp)
	{
		if(place_meeting(x,y,obj_mask))instance_destroy();
		else
		{
			ds_grid_set_region(other.map_stamp_grid_,_i,_j,_i+_w-1,_j+_h-1,1);//将房间里的网格标记为1
			other.map_stamp_number+=_w*_h;
			ds_grid_set_region(other.map_show_grid_,_i*2+1,_j*2+1,(_i+_w-1)*2+1,(_j+_h-1)*2+1,FLOOR);//将显示地图中房间设置为地板
			
		}
	}
	}
	
}